'use strict';
const http = require('../utils/httpUtils');
const namespace = require('./namespace');
module.exports = function (app) {
  //我的订单列表
  app.get(`${namespace.root}/order/index`, async function (req, res) {
    res.render('order/index', {
      orderState: req.query.state,
      isNotice: req.query.isNotice
    });
  });

  //卖家订单列表
  app.get(`${namespace.root}/order/sellerList`, async function (req, res) {
    res.render('order/sellerList', {
      orderState: req.query.state,
      isNotice: req.query.isNotice
    });
  });

  //买家订单详情
  app.get(`${namespace.root}/order/detail`, async function (req, res) {
    res.render('order/detail', {
      orderId: req.query.id,
      isNotice: req.query.isNotice
    });
  });

  //卖家订单详情
  app.get(`${namespace.root}/order/sellerDetail`, async function (req, res) {
    res.render('order/sellerDetail', {
      orderId: req.query.id,
      isNotice: req.query.isNotice
    });
  });

  //订单评价
  app.get(`${namespace.root}/add_evaluate`, async function (req, res) {

    res.render('order/evaluate', {
      orderId: req.query.id
    });
  });
  //申请退款
  app.get(`${namespace.root}/order/applyRefund`, async function (req, res) {

    res.render('order/applyRefund', {
      orderId: req.query.id
    });
  });
  //退款详情
  app.get(`${namespace.root}/order/refundDetail`, async function (req, res) {

    res.render('order/refundDetail', {
      orderId: req.query.id,
      isSeller: req.query.isSeller
    });
  });
  //选择收货地址
  app.get(`${namespace.root}/selectAddress`, async function (req, res) {

    res.render('order/selectAddress', {
      orderId: req.query.orderId
    });
  });
};